//
//  UINavigationItem+Offset.m
//  WC
//
//  Created by 杨鑫 on 15/4/27.
//  Copyright (c) 2015年 智康. All rights reserved.
//

#import "UINavigationItem+Offset.h"

@implementation UINavigationItem (Offset)

- (void)addLeftBarButtonItem:(UIView *)view
{
    UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
    negativeSpacer.width = -10;
    
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:view];
    
    [self setLeftBarButtonItems:[NSArray arrayWithObjects:negativeSpacer, leftItem, nil]];
}

- (void)addRightBarButtonItem:(UIView *)view
{
    UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
    negativeSpacer.width = -10;
    
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:view];
    
    [self setRightBarButtonItems:[NSArray arrayWithObjects:negativeSpacer, rightItem, nil]];
}

@end
